mouse_events = [MOUSE_LEFT,MOUSE_MIDDLE,MOUSE_RIGHT];

keys = [];

isPressed = function(key){
	nkeys = getKeys();
	for (nkey in nkeys){
		if (nkeys[nkey] == key){
			return true;
		}
	}
	for (k in keys){
		if (keys[k]==key){
			keys = tkeys;
			return true;
		}
	}
	keys = nkeys;
}

function getKeys(){
	keys=[];
	while(AreKeysLeft()){
		keys.push(GetKey());
	}
}